package com.dayaokeji.rhythmschoolstudent.client.mine.account

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.support.v4.app.Fragment
import com.dayaokeji.rhythmschoolstudent.R
import com.dayaokeji.rhythmschoolstudent.client.common.CommonWebClientFragment
import com.dayaokeji.rhythmschoolstudent.client.common.base.ActivityTemplateMethod
import com.dayaokeji.rhythmschoolstudent.client.common.base.common.BaseActivity
import kotlinx.android.synthetic.main.activity_user_privacy_policy.*

/**
 * 用户隐私政策
 */
class UserPrivacyPolicyActivity : BaseActivity() , ActivityTemplateMethod{

    companion object {
        private const val HELPER_URL = "http://www.jiantuokeji.com/LvDongXiaoYuan/page.php?id=7"
        private const val FRAGMENT_TAG = "web_tag"

        fun navigation(cxt: Context?) {
            cxt?.startActivity(Intent(cxt,UserPrivacyPolicyActivity::class.java))
        }
    }

    private var webClientFragment: Fragment? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_user_privacy_policy)
        setSupportActionBar(toolbar)
        init()
    }

    override fun setupView() {
        webClientFragment = supportFragmentManager.findFragmentByTag(FRAGMENT_TAG)
        if (webClientFragment == null) {
            webClientFragment = CommonWebClientFragment.newInstance(HELPER_URL)
        }
        supportFragmentManager.beginTransaction().replace(R.id.fl_content, this!!.webClientFragment!!, FRAGMENT_TAG).commit()
    }

    override fun setupViewData() {
    }
}
